Skip to content

Nicknames: Northern Sky Raid Tools compatibility (precedence popup)#152

Open
Maelareth wants to merge 2 commits into
DanderBot:mainfrom
Maelareth:feature/nickname-conflict-popup
Open

Nicknames: Northern Sky Raid Tools compatibility (precedence popup)#152
Maelareth wants to merge 2 commits into
DanderBot:mainfrom
Maelareth:feature/nickname-conflict-popup

Conversation

@Maelareth

Copy link
Copy Markdown

Problem

Northern Sky Raid Tools can also be set to put nicknames on DandersFrames frames. When its Global Nicknames + DandersFrames toggles are on, it hard-overwrites DF:GetUnitName with its own resolver — so with both addons managing names, the displayed name silently depends on load order and whichever addon refreshed last. Users get no signal that the two are fighting.

(Discussed beforehand — this implements the approach you signed off on.)

Solution — entirely DF-side

NSRT is never modified or written to; we only read its settings.

  • DF:GetFrameName(unit) (Frames/Core.lua) — new display entry point used by our four render call sites (Bars, Update ×2, Text Designer DataSource). DF:GetUnitName stays untouched as the public hook point for external addons.
  • NK:GetDisplayName(unit) — honours a stored framePrecedence choice: DF's own nicknames resolve first by default; if the user chose NSRT, we yield by calling NSAPI:GetName(name, "DandersFrames") directly (their own internal call — honours their per-addon toggle and Secret Values guards).
  • One-time popup — if both addons are set to manage names and no choice has been made, a DF-styled prompt asks which addon should decide, once. Deferred out of combat (PLAYER_REGEN_ENABLED), Esc re-asks next login. Only shown to users who actually HAVE DF nicknames (entries, received, or a broadcast nick), so plain NSRT users are never nagged.
  • Settings control — General → Nicknames gains a Name precedence dropdown (only rendered when NSRT is installed) to change the choice later.
  • All strings localised (L[...] + enUS registration; addon names passed as format args).

Notes

  • When DF has precedence, NSRT still overwrites GetUnitName and runs its frame updates in the background — harmless (our render path resolves first), just a few wasted cycles on their side.
  • Mid-session changes to NSRT's toggles are picked up by the precedence logic immediately, but the popup itself is only evaluated at login.
  • Works with both load orders (NSRT inits nicknames at ADDON_LOADED, our hook installs at PLAYER_LOGIN).

Testing

  • Both addons managing names → popup appears once; both buttons flip the displayed names live; choice persists across reloads (account-wide).
  • Precedence verified in-game both ways via /dump probes on GetFrameName/GetDisplayName.
  • Dropdown mirrors and updates the same stored choice.
  • No NSRT installed → no popup, no dropdown, zero behaviour change.

Maelareth added 2 commits June 11, 2026 07:22
Detect when Northern Sky Raid Tools is also set to manage names on DandersFrames frames (it overwrites DF:GetUnitName), and prompt the user once which should win. The choice (framePrecedence) is honoured by a new DF:GetFrameName that resolves our own nicknames first, so DandersFrames stays authoritative even though NSRT re-overwrites the hook. Entirely DF-side: only reads NSRT's toggle, never modifies it. Popup strings hard-coded for the prototype; localise before merge.
- Localise all popup strings (L[...] + enUS registration); addon names are passed as format args so translators never touch them

- Add a Name precedence dropdown to the Nicknames options page (only shown when NSRT is installed), making good on the popup's 'change it later' promise

- Only prompt when the user actually has DF nicknames to show (entries, received, or a broadcast nick) - without this every NSRT user would get the popup with nothing to choose between

- CHANGELOG entry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant